<template>
	<view class="content">
		<!-- 空白页 -->
		<empty v-if="deposit_list.length === 0"></empty>
		<scroll-view class="list-scroll-content" scroll-y="true" @scrolltolower="getDepositList" style="height: 800px;">
		
		<!-- 运费模板列表 -->
		<view class="deposit-list-box">
			<view
				v-for="(item,index) in charge_list" :key="index"
				class="deposit-list-item"
			>
				<view class="deposit-list-item-left">
					<view>余额充值</view>
					<view>+{{item.amount}}</view>
				</view>
				<view class="deposit-list-item-right">
					<view>充值成功</view>
					<view class="deposit-date">{{item.create_time}}</view>
				</view>
			</view>
		</view>
		<uni-load-more :status="loadingType"></uni-load-more>
		</scroll-view>
	</view>
</template> 

<script>
	import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
	export default {
		components: {
			
		},
		data() {
			return {
				charge_list:[],
				page: 1,
				loadingType: 'more',
			};
		},
		
		onLoad(options){
			uni.hideShareMenu()
		},
		onShow() {

			
		},
		methods: {
			navTo(url){
				uni.navigateTo({ url })
			}, 
			async getDepositList(){
				let res = await Api.apiCall('get', Api.weixin.rechargeList, {
					user_id:this.user.user_id,
					page:this.page
				});
				if(res.code==200){
					if(res.data.data.length>0){
						this.charge_list = this.charge_list.concat(res.data.data);
						this.page++
					}else{
						this.loadingType='nomore'
					}
				}
			},
		},
	}
</script>

<style lang="scss">
	page, .content{
		background: $page-color-base;
		height: 100%;
	}
	.deposit-list-box{
		margin-top: 16upx;
		.deposit-list-item{
			height: 120upx;
			line-height: 60upx;
			background-color: #FFFFFF;
			margin-top: 16upx;
			.deposit-list-item-left{
				padding-left: 5%;
				width: 45%;
				float: left;
			}
			.deposit-list-item-right{
				width: 50%;
				float: right;
				.deposit-date{
					color: #606266;
					font-size: 24upx;
				}
			}
		}
	}
</style>
